package com.ledim.itf;

import android.view.MotionEvent;
import android.view.View;

/**
 * Created by qjq on 16/9/23 16:21.
 * 双击事件Listener
 */

public abstract class LedimDoubleClickListener implements View.OnTouchListener {

    private long mClick_time;

    @Override
    public boolean onTouch(View v, MotionEvent event) {
        long newClickTime = System.currentTimeMillis();
        if (event.getAction() == MotionEvent.ACTION_DOWN) {
            if (newClickTime - mClick_time < 500) {//调用双击事件  
                onDoubleClick(v);
            }
        }
        mClick_time = newClickTime;
        return false;

    }

    public abstract void onDoubleClick(View view);
}
